package com.example.chronicdisease.controller;

import com.example.chronicdisease.pojo.Setmeal;
import com.example.chronicdisease.response.ApiRestResponse;
import com.example.chronicdisease.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @Autowired
    SetmealService setmealService;

    @RequestMapping("/listByType")
    public ApiRestResponse listByType(@RequestBody Setmeal setmeal){

        return ApiRestResponse.success(setmealService.listByType(setmeal));
    }

    @RequestMapping("/getSetmealById")
    public ApiRestResponse getSetmealById(@RequestBody Setmeal setmeal){

        return ApiRestResponse.success(setmealService.getSetmealById(setmeal));
    }


}
